﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

namespace MLY.LTR
{
    public partial class OrgInfo : Bll.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {

                Response.Expires = 0;
                ViewState["Referer"] = Request.ServerVariables["HTTP_REFERER"];
                int orgId = int.Parse(Session["OrganizationId"].ToString());
                
                 MLY.Bll.clsOrganization org = new MLY.Bll.clsOrganization(orgId);
                
                this.txtName.Text = org.Data.OrganizationName.ToString();
                //this.ddlPayMentType.SelectedValue = org.Data.PaymentTypeId.ToString();
                PaymentType.Text = org.Data.PaymentTypeId.ToString();
                this.txtTag.Text = org.Data.Tag;
                this.txtAddress.Text = org.Data.Address;
                this.txtContactEMail.Text = "<a href=\"mailto:" + org.Data.ContactPersonEmail + "\">"
                    + org.Data.ContactPersonEmail + "</a>";
                this.txtContactPhone.Text = org.Data.ContactPersonPhone;
                this.txtContactPerson.Text = org.Data.ContactPerson;
                this.txtWebSite.Text = "<a href=\"http://" + org.Data.WebSite + "\" target=\"_blank\">" +
                    org.Data.WebSite + "</a>";
                //this.CheckBoxClient.Checked = (bool)org.Data.IsClient;
                //this.CheckBoxContractor.Checked = (bool)org.Data.IsContractor;
                   
            }
        }

        protected void imgbtnClose_Click(object sender, EventArgs e)
        {
            Response.RedirectTo((string)ViewState["Referer"]);
        }
    }
}
